﻿using Cherry.Agile.Enterprise.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;

namespace Cherry.Agile.Enterprise.Services.Interface
{
    /// <summary>
    /// 行政区域
    /// </summary>
    [ServiceContract(Namespace = Unity.Namespace)]
    public interface IAreaService
    {
        /// <summary>
        /// 添加行政区域
        /// </summary>
        /// <param name="area"></param>
        [OperationContract]
        void AddArea(Area area);

        ///// <summary>
        ///// 
        ///// </summary>
        ///// <returns></returns>
        //[OperationContract]
        //List<AreaExtensionInfo> GetAllAreaExtensionInfo();
        /// <summary>
        /// 添加多个
        /// </summary>
        /// <param name="areaList"></param>
        [OperationContract]
        void AddMulArea(List<Area> areaList);
        /// <summary>
        /// 修改行政区域
        /// </summary>
        /// <param name="area"></param>
        [OperationContract]
        void UpdateArea(Area area);

        /// <summary>
        /// 删除行政区域
        /// </summary>
        /// <param name="areaId"></param>
        [OperationContract]
        int DeleteArea(int areaId);

        /// <summary>
        /// 存在子区域
        /// </summary>
        /// <param name="areaId"></param>
        [OperationContract]
        bool HasChild(int areaId);
        /// <summary>
        /// 获取行政区域
        /// </summary>
        /// <returns>行政区域集合</returns>
        [OperationContract]
        List<Area> SyncArea();

        /// <summary>
        /// 获取行政区域
        /// </summary>
        /// <returns>行政区域集合</returns>
        [OperationContract]
        List<Area> GetAreas();

        /// <summary>
        /// 根据上级行政区域ID获取下一级行政区域
        /// </summary>
        /// <param name="parentID">上级行政区域ID</param>
        /// <returns>下一级行政区域列表</returns>
        [OperationContract]
        List<Area> GetByParentID(int parentID);

        /// <summary>
        /// 根据行政区域ID获取行政区域信息
        /// </summary>
        /// <param name="areaID">行政区域ID</param>
        /// <returns>行政区域信息</returns>
        [OperationContract]
        Area GetByAreaID(int areaID);

        ///// <summary>
        ///// 获取行政区域扩展实体
        ///// </summary>
        ///// <param name="areaId"></param>
        ///// <returns></returns>
        //[OperationContract]
        //AreaExtensionInfo GetAreaExtensionByAreaId(int areaId);

        ///// <summary>
        ///// 
        ///// </summary>
        ///// <param name="areaId"></param>
        ///// <returns></returns>
        //[OperationContract]
        //List<AreaExtensionInfo> GetAreaExtensionInfoListByParentId(int areaId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="areaName"></param>
        /// <param name="checkField"></param>
        /// <param name="parentAreaId"></param>
        /// <returns></returns>
        [OperationContract]
        bool IsAreaNameExistForAdd(string areaName, string checkField, int parentAreaId);


        /// <summary>
        /// 
        /// </summary>
        /// <param name="areaName"></param>
        /// <param name="checkField"></param>
        /// <param name="areaId"></param>
        /// <param name="parentAreaId"></param>
        /// <returns></returns>
        [OperationContract]
        bool IsAreaNameExistForUpdate(string areaName, string checkField, int areaId, int parentAreaId);

    }
}
